﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Windows;

namespace Bixas.Tangibilis.Controls.Primitives
{
    public delegate void TouchRotateStartedEventHandler(object sender, TouchRotateStartedEventArgs e);

    public class TouchRotateStartedEventArgs : RoutedEventArgs
    {
        // Fields

        // Methods
        public TouchRotateStartedEventArgs()
        {
            base.RoutedEvent = TouchThumb.TouchRotateStartedEvent;
        }

        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
        {
            TouchRotateStartedEventHandler handler = (TouchRotateStartedEventHandler)genericHandler;
            handler(genericTarget, this);
        }
    }

    public delegate void TouchRotateDeltaEventHandler(object sender, TouchRotateDeltaEventArgs e);

    public class TouchRotateDeltaEventArgs : RoutedEventArgs
    {
        // Fields
        private double _angle;
        
        // Methods
        public TouchRotateDeltaEventArgs(double angle)
        {
            this._angle = angle;
            base.RoutedEvent = TouchThumb.TouchRotateDeltaEvent;                
        }

        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
        {
            TouchRotateDeltaEventHandler handler = (TouchRotateDeltaEventHandler)genericHandler;
            handler(genericTarget, this);
        }

        // Properties
        public double Angle
        {
            get
            {
                return this._angle;
            }
        }

    }

    public delegate void TouchRotateCompletedEventHandler(object sender, TouchRotateCompletedEventArgs e);

    public class TouchRotateCompletedEventArgs : RoutedEventArgs
    {
        // Fields
        private double _angle;
        private bool _wasCanceled;

        // Methods
        public TouchRotateCompletedEventArgs(double angle, bool canceled)
        {
            this._angle = angle;
            this._wasCanceled = canceled;
            base.RoutedEvent = TouchThumb.TouchRotateCompletedEvent;
        }

        protected override void InvokeEventHandler(Delegate genericHandler, object genericTarget)
        {
            TouchRotateCompletedEventHandler handler = (TouchRotateCompletedEventHandler)genericHandler;
            handler(genericTarget, this);
        }

        // Properties
        public bool Canceled
        {
            get
            {
                return this._wasCanceled;
            }
        }

        public double Angle
        {
            get
            {
                return this._angle;
            }
        }
    }








}
